/**
 * Generate time : 2011-07-20 8:40:07
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cs.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCSWorkSchedule
 * 
 */
public class ZMCSWorkSchedule extends DaoEPBase {

	private String fdKeyId = " ";
	private String fdScheduleNum = " ";
	private String fdScheduleClassify = " ";
	private Long fdIsStart = new Long(0);
	private Long fdIsThrough = new Long(0);
	private String fdStartTime = " ";
	private String fdEndTime = " ";
	private Long fdSerialNum = new Long(0);
	private String fdRemark = " ";

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdScheduleNum");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("班次");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdScheduleClassify");
		eiColumn.setFieldLength(50);
		eiColumn.setDescName("班次分类");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsStart");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("起始班次");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdIsThrough");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("跨天");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdStartTime");
		eiColumn.setFieldLength(14);
		eiColumn.setDescName("起始时间");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdEndTime");
		eiColumn.setFieldLength(14);
		eiColumn.setDescName("结束时间");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdSerialNum");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("顺序号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdRemark");
		eiColumn.setFieldLength(500);
		eiColumn.setDescName("备注");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCSWorkSchedule() {
		initMetaData();
	}

	/**
	 * get the fdKeyId
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdScheduleNum
	 * 
	 * @return the fdScheduleNum
	 */
	public String getFdScheduleNum() {
		return this.fdScheduleNum;
	}

	/**
	 * set the fdScheduleNum
	 */
	public void setFdScheduleNum(String fdScheduleNum) {
		this.fdScheduleNum = fdScheduleNum;
	}
	
	/**
	 * get the fdScheduleClassify
	 * 
	 * @return the fdScheduleClassify
	 */
	public String getFdScheduleClassify() {
		return this.fdScheduleClassify;
	}

	/**
	 * set the fdScheduleClassify
	 */
	public void setFdScheduleClassify(String fdScheduleClassify) {
		this.fdScheduleClassify = fdScheduleClassify;
	}

	/**
	 * get the fdSerialNum
	 * 
	 * @return the fdSerialNum
	 */
	public Long getFdSerialNum() {
		return this.fdSerialNum;
	}

	/**
	 * set the fdSerialNum
	 */
	public void setFdSerialNum(Long fdSerialNum) {
		this.fdSerialNum = fdSerialNum;
	}

	/**
	 * get the fdIsThrough
	 * 
	 * @return the fdIsThrough
	 */
	public Long getFdIsThrough() {
		return this.fdIsThrough;
	}

	/**
	 * set the fdIsThrough
	 */
	public void setFdIsThrough(Long fdIsThrough) {
		this.fdIsThrough = fdIsThrough;
	}

	/**
	 * get the fdStartTime
	 * 
	 * @return the fdStartTime
	 */
	public String getFdStartTime() {
		return this.fdStartTime;
	}

	/**
	 * set the fdStartTime
	 */
	public void setFdStartTime(String fdStartTime) {
		this.fdStartTime = fdStartTime;
	}

	/**
	 * get the fdEndTime
	 * 
	 * @return the fdEndTime
	 */
	public String getFdEndTime() {
		return this.fdEndTime;
	}

	/**
	 * set the fdEndTime
	 */
	public void setFdEndTime(String fdEndTime) {
		this.fdEndTime = fdEndTime;
	}

	/**
	 * get the fdIsStart
	 * 
	 * @return the fdIsStart
	 */
	public Long getFdIsStart() {
		return this.fdIsStart;
	}

	/**
	 * set the fdIsStart
	 */
	public void setFdIsStart(Long fdIsStart) {
		this.fdIsStart = fdIsStart;
	}
	
	/**
	 * get the fdRemark
	 * 
	 * @return the fdRemark
	 */
	public String getFdRemark() {
		return this.fdRemark;
	}

	/**
	 * set the fdRemark
	 */
	public void setFdRemark(String fdRemark) {
		this.fdRemark = fdRemark;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdScheduleNum(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdScheduleNum")), fdScheduleNum));
		setFdScheduleClassify(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdScheduleClassify")), fdScheduleClassify));
		setFdIsStart(NumberUtils.toLong(StringUtils.toString(map.get("fdIsStart")), fdIsStart));
		setFdIsThrough(NumberUtils.toLong(StringUtils.toString(map.get("fdIsThrough")), fdIsThrough));
		setFdStartTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdStartTime")), fdStartTime));
		setFdEndTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdEndTime")), fdEndTime));
		setFdSerialNum(NumberUtils.toLong(StringUtils.toString(map.get("fdSerialNum")), fdSerialNum));
		setFdRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdRemark")), fdRemark));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdScheduleNum", StringUtils.toString(fdScheduleNum, eiMetadata.getMeta("fdScheduleNum")));
		map.put("fdScheduleClassify", StringUtils.toString(fdScheduleClassify, eiMetadata.getMeta("fdScheduleClassify")));
		map.put("fdIsStart", StringUtils.toString(fdIsStart, eiMetadata.getMeta("fdIsStart")));
		map.put("fdIsThrough", StringUtils.toString(fdIsThrough, eiMetadata.getMeta("fdIsThrough")));
		map.put("fdStartTime", StringUtils.toString(fdStartTime, eiMetadata.getMeta("fdStartTime")));
		map.put("fdEndTime", StringUtils.toString(fdEndTime, eiMetadata.getMeta("fdEndTime")));
		map.put("fdSerialNum", StringUtils.toString(fdSerialNum, eiMetadata.getMeta("fdSerialNum")));
		map.put("fdRemark", StringUtils.toString(fdRemark, eiMetadata.getMeta("fdRemark")));

		return map;

	}
}